package cn.b.sky.mes.mm.model.condition;

import java.util.Date;

import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;

import cn.b.sky.common.model.Page;
import cn.b.sky.user.SecurityContextUtil;

/**
 * 
 * <strong>Title : RequirementCondition.java<br></strong>
 * <strong>Package : cn.b.sky.mes.mm.model.condition<br></strong>
 * <strong>Description : </strong>物料需求查询条件<br> 
 * <strong>Create on : 2016年9月22日 上午9:49:34<br></strong>
 * <p>
 * @author dapeng.li<br>
 * @version <strong>v1.0.0</strong><br>
 * <br>
 * <strong>修改历史:</strong><br>
 * 修改人|修改日期|修改描述<br>
 * -------------------------------------------<br>
 * <br>
 * <br>
 */
public class RequirementCondition extends Page {

  /**
   * 需求编号
   */
  private String requirementNum;

  /**
   * 物料编号
   */
  private String materialCode;

  /**
   * 物料描述
   */
  private String materialText;

  /**
   * 物料规格
   */
  private String materialSpec;

  /**
   * 需求数量
   */
  private Double requirementQuantity;

  /**
   * 已配送数量
   */
  private Double distributionQuantity;

  /**
   * 配送形式编号
   */
  private String distributionModeCode;

  /**
   * 拉动策略编号
   */
  private String pullStrategyCode;

  /**
   * 物料需求触发策略编号
   */
  private String requirementTriggerModeCode;

  /**
   * 物料配送触发策略编号
   */
  private String distributionTriggerModeCode;

  /**
   * 状态
   */
  private String statusECode;

  /**
   * 生产订单编号
   */
  private String productionOrderNum;

  /**
   * 生产管理号
   */
  private String productionControlNum;

  /**
   * 工艺工序ID
   */
  private Integer processOperationId;

  /**
   * 工作中心编号
   */
  private String workcenterCode;

  /**
   * 工作中心描述
   */
  private String workcenterText;

  /**
   * 作业单元编号
   */
  private String workunitCode;

  /**
   * 作业单元描述
   */
  private String workunitText;

  /**
   * 线边仓库编号
   */
  private String warehouseCode;

  /**
   * 线边仓库描述
   */
  private String warehouseText;

  /**
   * 线边库位编号
   */
  private String storageLocationCode;

  /**
   * 线边库位描述
   */
  private String storageLocationText;

  /**
   * 配送编号
   */
  private String distributionCode;

  /**
   * 配送人员
   */
  private String distributionUser;

  /**
   * 配送超时
   */
  private Integer distributionTimeoutFlag;

  /**
   * 更新版本
   */
  private Integer updateVersion;

  /**
   * 期望到货时间
   */
  @DateTimeFormat(iso = ISO.DATE_TIME, pattern = "yyyy-MM-dd HH:mm:ss")
  private Date expectedArrivalDateTime;

  /**
   * 需求关闭人
   */
  private String closeUser;

  /**
   * 需求关闭时间
   */
  private Date closeDateTime;

  /**
   * 语言编码
   */
  private String languageCode;

  /**
   * 创建时间（从）
   */
  @DateTimeFormat(iso = ISO.DATE, pattern = "yyyy-MM-dd")
  private Date minCreateDate;

  /**
   * 创建时间（到）
   */
  @DateTimeFormat(iso = ISO.DATE, pattern = "yyyy-MM-dd")
  private Date maxCreateDate;

  /**
   * 查询状态
   */
  private String[] statusECodes;

  /**
   * 需求关闭时间begin
   */
  @DateTimeFormat(iso = ISO.DATE_TIME, pattern = "yyyy-MM-dd HH:mm:ss")
  private Date minCloseDateTime;

  /**
   * 需求关闭时间end
   */
  @DateTimeFormat(iso = ISO.DATE_TIME, pattern = "yyyy-MM-dd HH:mm:ss")
  private Date maxCloseDateTime;

  /**
  * 期望到货时间begin
  */
  @DateTimeFormat(iso = ISO.DATE_TIME, pattern = "yyyy-MM-dd HH:mm:ss")
  private Date minExpectedArrivalDateTime;

  /**
   * 期望到货时间end
   */
  @DateTimeFormat(iso = ISO.DATE_TIME, pattern = "yyyy-MM-dd HH:mm:ss")
  private Date maxExpectedArrivalDateTime;

  public String getRequirementNum() {
    return requirementNum;
  }

  public void setRequirementNum(String requirementNum) {
    this.requirementNum = requirementNum;
  }

  public String getMaterialCode() {
    return materialCode;
  }

  public void setMaterialCode(String materialCode) {
    this.materialCode = materialCode;
  }

  public String getMaterialText() {
    return materialText;
  }

  public void setMaterialText(String materialText) {
    this.materialText = materialText;
  }

  public String getMaterialSpec() {
    return materialSpec;
  }

  public void setMaterialSpec(String materialSpec) {
    this.materialSpec = materialSpec;
  }

  public Double getRequirementQuantity() {
    return requirementQuantity;
  }

  public void setRequirementQuantity(Double requirementQuantity) {
    this.requirementQuantity = requirementQuantity;
  }

  public Double getDistributionQuantity() {
    return distributionQuantity;
  }

  public void setDistributionQuantity(Double distributionQuantity) {
    this.distributionQuantity = distributionQuantity;
  }

  public String getDistributionModeCode() {
    return distributionModeCode;
  }

  public void setDistributionModeCode(String distributionModeCode) {
    this.distributionModeCode = distributionModeCode;
  }

  public String getPullStrategyCode() {
    return pullStrategyCode;
  }

  public void setPullStrategyCode(String pullStrategyCode) {
    this.pullStrategyCode = pullStrategyCode;
  }

  public String getRequirementTriggerModeCode() {
    return requirementTriggerModeCode;
  }

  public void setRequirementTriggerModeCode(String requirementTriggerModeCode) {
    this.requirementTriggerModeCode = requirementTriggerModeCode;
  }

  public String getDistributionTriggerModeCode() {
    return distributionTriggerModeCode;
  }

  public void setDistributionTriggerModeCode(String distributionTriggerModeCode) {
    this.distributionTriggerModeCode = distributionTriggerModeCode;
  }

  public String getStatusECode() {
    return statusECode;
  }

  public void setStatusECode(String statusECode) {
    this.statusECode = statusECode;
  }

  public String getProductionOrderNum() {
    return productionOrderNum;
  }

  public void setProductionOrderNum(String productionOrderNum) {
    this.productionOrderNum = productionOrderNum;
  }

  public String getProductionControlNum() {
    return productionControlNum;
  }

  public void setProductionControlNum(String productionControlNum) {
    this.productionControlNum = productionControlNum;
  }

  public Integer getProcessOperationId() {
    return processOperationId;
  }

  public void setProcessOperationId(Integer processOperationId) {
    this.processOperationId = processOperationId;
  }

  public String getWorkcenterCode() {
    return workcenterCode;
  }

  public void setWorkcenterCode(String workcenterCode) {
    this.workcenterCode = workcenterCode;
  }

  public String getWorkcenterText() {
    return workcenterText;
  }

  public void setWorkcenterText(String workcenterText) {
    this.workcenterText = workcenterText;
  }

  public String getWorkunitCode() {
    return workunitCode;
  }

  public void setWorkunitCode(String workunitCode) {
    this.workunitCode = workunitCode;
  }

  public String getWorkunitText() {
    return workunitText;
  }

  public void setWorkunitText(String workunitText) {
    this.workunitText = workunitText;
  }

  public String getWarehouseCode() {
    return warehouseCode;
  }

  public void setWarehouseCode(String warehouseCode) {
    this.warehouseCode = warehouseCode;
  }

  public String getWarehouseText() {
    return warehouseText;
  }

  public void setWarehouseText(String warehouseText) {
    this.warehouseText = warehouseText;
  }

  public String getStorageLocationCode() {
    return storageLocationCode;
  }

  public void setStorageLocationCode(String storageLocationCode) {
    this.storageLocationCode = storageLocationCode;
  }

  public String getStorageLocationText() {
    return storageLocationText;
  }

  public void setStorageLocationText(String storageLocationText) {
    this.storageLocationText = storageLocationText;
  }

  public String getDistributionCode() {
    return distributionCode;
  }

  public void setDistributionCode(String distributionCode) {
    this.distributionCode = distributionCode;
  }

  public String getDistributionUser() {
    return distributionUser;
  }

  public void setDistributionUser(String distributionUser) {
    this.distributionUser = distributionUser;
  }

  public Integer getDistributionTimeoutFlag() {
    return distributionTimeoutFlag;
  }

  public void setDistributionTimeoutFlag(Integer distributionTimeoutFlag) {
    this.distributionTimeoutFlag = distributionTimeoutFlag;
  }

  public Integer getUpdateVersion() {
    return updateVersion;
  }

  public void setUpdateVersion(Integer updateVersion) {
    this.updateVersion = updateVersion;
  }

  public Date getExpectedArrivalDateTime() {
    return expectedArrivalDateTime;
  }

  public void setExpectedArrivalDateTime(Date expectedArrivalDateTime) {
    this.expectedArrivalDateTime = expectedArrivalDateTime;
  }

  public String getCloseUser() {
    return closeUser;
  }

  public void setCloseUser(String closeUser) {
    this.closeUser = closeUser;
  }

  public Date getCloseDateTime() {
    return closeDateTime;
  }

  public void setCloseDateTime(Date closeDateTime) {
    this.closeDateTime = closeDateTime;
  }

  public Date getMinCreateDate() {
    return minCreateDate;
  }

  public void setMinCreateDate(Date minCreateDate) {
    this.minCreateDate = minCreateDate;
  }

  public Date getMaxCreateDate() {
    return maxCreateDate;
  }

  public void setMaxCreateDate(Date maxCreateDate) {
    this.maxCreateDate = maxCreateDate;
  }

  public String[] getStatusECodes() {
    return statusECodes;
  }

  public void setStatusECodes(String[] statusECodes) {
    this.statusECodes = statusECodes;
  }

  public Date getMinCloseDateTime() {
    return minCloseDateTime;
  }

  public void setMinCloseDateTime(Date minCloseDateTime) {
    this.minCloseDateTime = minCloseDateTime;
  }

  public Date getMaxCloseDateTime() {
    return maxCloseDateTime;
  }

  public void setMaxCloseDateTime(Date maxCloseDateTime) {
    this.maxCloseDateTime = maxCloseDateTime;
  }

  public Date getMinExpectedArrivalDateTime() {
    return minExpectedArrivalDateTime;
  }

  public void setMinExpectedArrivalDateTime(Date minExpectedArrivalDateTime) {
    this.minExpectedArrivalDateTime = minExpectedArrivalDateTime;
  }

  public Date getMaxExpectedArrivalDateTime() {
    return maxExpectedArrivalDateTime;
  }

  public void setMaxExpectedArrivalDateTime(Date maxExpectedArrivalDateTime) {
    this.maxExpectedArrivalDateTime = maxExpectedArrivalDateTime;
  }

  public String getLanguageCode() {
    if (StringUtils.isEmpty(languageCode)) {
      return SecurityContextUtil.getLanguageCode();
    }
    return languageCode;
  }

  public void setLanguageCode(String languageCode) {
    this.languageCode = languageCode;
  }

}
